<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button>点击</button>
<script>
  const btn=document.querySelector('button')
  btn.addEventListener('click',function (){
    alert('点击了按钮')
  })
  btn.addEventListener('mouseenter',function (){
    document.write('你经过了按钮')
  })
</script>
</body>
</html>